<?php

/**
 * Application Models
 *
 * @package Application_Model
 * @subpackage Model
 * @author <YOUR NAME HERE>
 * @copyright ZF model generator
 * @license http://framework.zend.com/license/new-bsd     New BSD License
 */

/**
 * Abstract class for models
 */
require_once 'ModelAbstract.php';

/**
 * 
 *
 * @package Application_Model
 * @subpackage Model
 * @author <YOUR NAME HERE>
 */
class Application_Model_PilotNamecolumn extends Application_Model_ModelAbstract
{

    /**
     * Database var type int(11)
     *
     * @var int
     */
    protected $_IdPILOTNAMECOLUMN;

    /**
     * Database var type varchar(512)
     *
     * @var string
     */
    protected $_LABELLANGUE;

    /**
     * Database var type varchar(255)
     *
     * @var string
     */
    protected $_IdPILOTLISTCOLUMN;

    /**
     * Database var type varchar(45)
     *
     * @var string
     */
    protected $_IdLANGUE;


    /**
     * Parent relation fk_PILOT_NAMECOLUMN_PILOT_LISTCOLUMN1
     *
     * @var Application_Model_PilotListcolumn
     */
    protected $_PilotListcolumn;

    /**
     * Parent relation fk_PILOT_NAMECOLUMN_LANGUE1
     *
     * @var Application_Model_Langue
     */
    protected $_Langue;


    /**
     * Sets up column and relationship lists
     */
    public function __construct()
    {
        parent::init();
        $this->setColumnsList(array(
            'idPILOT_NAMECOLUMN'=>'IdPILOTNAMECOLUMN',
            'LABELLANGUE'=>'LABELLANGUE',
            'idPILOT_LISTCOLUMN'=>'IdPILOTLISTCOLUMN',
            'idLANGUE'=>'IdLANGUE',
        ));

        $this->setParentList(array(
            'FkPILOTNAMECOLUMNPILOTLISTCOLUMN1'=> array(
                    'property' => 'PilotListcolumn',
                    'table_name' => 'PilotListcolumn',
                ),
            'FkPILOTNAMECOLUMNLANGUE1'=> array(
                    'property' => 'Langue',
                    'table_name' => 'Langue',
                ),
        ));

        $this->setDependentList(array(
        ));
    }

    /**
     * Sets column idPILOT_NAMECOLUMN
     *
     * @param int $data
     * @return Application_Model_PilotNamecolumn
     */
    public function setIdPILOTNAMECOLUMN($data)
    {
        $this->_IdPILOTNAMECOLUMN = $data;
        return $this;
    }

    /**
     * Gets column idPILOT_NAMECOLUMN
     *
     * @return int
     */
    public function getIdPILOTNAMECOLUMN()
    {
        return $this->_IdPILOTNAMECOLUMN;
    }

    /**
     * Sets column LABELLANGUE
     *
     * @param string $data
     * @return Application_Model_PilotNamecolumn
     */
    public function setLABELLANGUE($data)
    {
        $this->_LABELLANGUE = $data;
        return $this;
    }

    /**
     * Gets column LABELLANGUE
     *
     * @return string
     */
    public function getLABELLANGUE()
    {
        return $this->_LABELLANGUE;
    }

    /**
     * Sets column idPILOT_LISTCOLUMN
     *
     * @param string $data
     * @return Application_Model_PilotNamecolumn
     */
    public function setIdPILOTLISTCOLUMN($data)
    {
        $this->_IdPILOTLISTCOLUMN = $data;
        return $this;
    }

    /**
     * Gets column idPILOT_LISTCOLUMN
     *
     * @return string
     */
    public function getIdPILOTLISTCOLUMN()
    {
        return $this->_IdPILOTLISTCOLUMN;
    }

    /**
     * Sets column idLANGUE
     *
     * @param string $data
     * @return Application_Model_PilotNamecolumn
     */
    public function setIdLANGUE($data)
    {
        $this->_IdLANGUE = $data;
        return $this;
    }

    /**
     * Gets column idLANGUE
     *
     * @return string
     */
    public function getIdLANGUE()
    {
        return $this->_IdLANGUE;
    }

    /**
     * Sets parent relation IdPILOTLISTCOLUMN
     *
     * @param Application_Model_PilotListcolumn $data
     * @return Application_Model_PilotNamecolumn
     */
    public function setPilotListcolumn(Application_Model_PilotListcolumn $data)
    {
        $this->_PilotListcolumn = $data;

        $primary_key = $data->getPrimaryKey();
        if (is_array($primary_key)) {
            $primary_key = $primary_key['idPILOT_LISTCOLUMN'];
        }

        $this->setIdPILOTLISTCOLUMN($primary_key);

        return $this;
    }

    /**
     * Gets parent IdPILOTLISTCOLUMN
     *
     * @param boolean $load Load the object if it is not already
     * @return Application_Model_PilotListcolumn
     */
    public function getPilotListcolumn($load = true)
    {
        if ($this->_PilotListcolumn === null && $load) {
            $this->getMapper()->loadRelated('FkPILOTNAMECOLUMNPILOTLISTCOLUMN1', $this);
        }

        return $this->_PilotListcolumn;
    }

    /**
     * Sets parent relation IdLANGUE
     *
     * @param Application_Model_Langue $data
     * @return Application_Model_PilotNamecolumn
     */
    public function setLangue(Application_Model_Langue $data)
    {
        $this->_Langue = $data;

        $primary_key = $data->getPrimaryKey();
        if (is_array($primary_key)) {
            $primary_key = $primary_key['idLANGUE'];
        }

        $this->setIdLANGUE($primary_key);

        return $this;
    }

    /**
     * Gets parent IdLANGUE
     *
     * @param boolean $load Load the object if it is not already
     * @return Application_Model_Langue
     */
    public function getLangue($load = true)
    {
        if ($this->_Langue === null && $load) {
            $this->getMapper()->loadRelated('FkPILOTNAMECOLUMNLANGUE1', $this);
        }

        return $this->_Langue;
    }

    /**
     * Returns the mapper class for this model
     *
     * @return Application_Model_Mapper_PilotNamecolumn
     */
    public function getMapper()
    {
        if ($this->_mapper === null) {
            $this->setMapper(new Application_Model_Mapper_PilotNamecolumn());
        }

        return $this->_mapper;
    }

    /**
     * Deletes current row by deleting the row that matches the primary key
     *
	 * @see Application_Model_Mapper_PilotNamecolumn::delete
     * @return int|boolean Number of rows deleted or boolean if doing soft delete
     */
    public function deleteRowByPrimaryKey()
    {
        if ($this->getIdPILOTNAMECOLUMN() === null) {
            throw new Exception('Primary Key does not contain a value');
        }

        return $this->getMapper()
                    ->getDbTable()
                    ->delete('idPILOT_NAMECOLUMN = ' .
                             $this->getMapper()
                                  ->getDbTable()
                                  ->getAdapter()
                                  ->quote($this->getIdPILOTNAMECOLUMN()));
    }
}
